package inf.coach.mobile;

import java.util.ArrayList;
import java.util.List;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;



import android.content.res.Resources;

public class webservice {

	//private static final String SOAP_ACTION =  "http://localhost/webservice/Getuserinfo"; 
	private static final String NAMESPACE = "http://localhost/webservice";
    
    public static String login(String user,String pass){
    	
    	final String METHOD_NAME = "getUserInfo"; 
    	final String URL = "http://141.76.84.22/webservice/login.asmx?wsdl";
    	final String SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
    	String userid=null;
    	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		System.out.println("-"+user+"/"+pass+"-");  
        request.addProperty("username", user); 
        request.addProperty("password", pass); 
        
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
        envelope.dotNet = true;
        envelope.setOutputSoapObject(request); 
       

        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 
        System.out.println("start to try..");
        
        try 
        { 
            androidHttpTransport.call(SOAP_ACTION, envelope); 
            System.out.println("call");
            SoapObject resultsRequestSOAP = (SoapObject)envelope.bodyIn;
            System.out.println("bodyin");
            SoapObject results=(SoapObject)resultsRequestSOAP.getProperty(0);
            System.out.println("result");
            //String result=results.getProperty(18).toString();
            userid=results.getProperty("userid").toString();
            System.out.println(userid);
            return userid;
        } 
        catch (Exception e) 
        { 
         e.printStackTrace ();
         return "null";
        } 
    	
    }
    /*
    public static String logout(long userid){
    	final String METHOD_NAME = "postLogout"; 
    	final String URL = "http://141.76.84.22/webservice/logout.asmx?wsdl";
    	final String SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
    	
    	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
    	
        request.addProperty("uid", userid); 
        
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
        envelope.dotNet = true;
        envelope.setOutputSoapObject(request); 
       

        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

        try 
        { 
            androidHttpTransport.call(SOAP_ACTION, envelope); 
            SoapObject resultsRequestSOAP = (SoapObject)envelope.bodyIn;
            String info=resultsRequestSOAP.getProperty(0).toString();
            return info;
        } 
        catch (Exception e) 
        { 
         e.printStackTrace ();
         
         return null;
        } 
    }
    
public static String rigister(String firstname,String lastname,String birthday,String email,String telephone,String mphone,String typeblind,String username, String password, String sex,String country,String city){
    	
    	final String METHOD_NAME = "creatuser"; 
    	final String URL = "http://141.76.84.22/webservice/user.asmx?wsdl";
    	final String SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
    	
    	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		 
        request.addProperty("firstname", firstname); 
        request.addProperty("lastname", lastname);
        request.addProperty("birthday",birthday);
        request.addProperty("email",email);
        request.addProperty("telephone",telephone);
        request.addProperty("mphone",mphone);
        request.addProperty("typeblind",typeblind);
        request.addProperty("username",username);
        request.addProperty("password",password);
        request.addProperty("level",0);
        request.addProperty("sex",sex);
        request.addProperty("role","");
        request.addProperty("country",country);
        request.addProperty("city",city);
        
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
        envelope.dotNet = true;
        envelope.setOutputSoapObject(request); 
       

        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

        try 
        { 
            androidHttpTransport.call(SOAP_ACTION, envelope); 
            SoapObject resultsRequestSOAP = (SoapObject)envelope.bodyIn;
            SoapObject results=(SoapObject)resultsRequestSOAP.getProperty(0);
            String result=results.getProperty("info").toString();
            return result;
        } 
        catch (Exception e) 
        { 
         e.printStackTrace ();
         
         return null;
        } 
    }

public static List annotationviaGeo(double lat,double lon,int distance,boolean filters,boolean mobile){
	final String METHOD_NAME = "getAnnoViaGeo"; 
	final String URL = "http://141.76.84.22/webservice/annotation.asmx?wsdl";
	final String SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	List annos=new ArrayList();
	String flat=Double.toString(lat);
	String flon=Double.toString(lon);
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	
	request.addProperty("lat", flat);
	request.addProperty("lon",flon);
	request.addProperty("distance", distance);
	request.addProperty("filters", filters); 
	request.addProperty("mobile", mobile);
	
	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
    

     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         SoapObject resultsRequestSOAP = (SoapObject)envelope.bodyIn;
         
         if(!resultsRequestSOAP.equals(null))
         { 
        	if(resultsRequestSOAP.getPropertyCount()>0){
         SoapObject result=(SoapObject)resultsRequestSOAP.getProperty(0);	
        		
         int num=result.getPropertyCount();
          
         for(int i=0;i<num;i++)
         { 
        	 annotations anno=new annotations();
           SoapObject annotation=(SoapObject)result.getProperty(i);
           anno.userid=Integer.parseInt(annotation.getProperty("userid").toString());
           anno.osm_id=Integer.parseInt(annotation.getProperty("osm_id").toString());
           anno.poiid=Integer.parseInt(annotation.getProperty("poiid").toString());
           anno.version=Integer.parseInt(annotation.getProperty("version").toString());
           anno.anonymous=annotation.getProperty("anonymous").toString();
           anno.audio_alt=annotation.getProperty("audio_alt").toString();
           anno.audio_path=annotation.getProperty("audio_path").toString();
           anno.codx=annotation.getProperty("codx").toString();
           anno.cody=annotation.getProperty("cody").toString();
           anno.context=annotation.getProperty("context").toString();
           anno.creattime=annotation.getProperty("creattime").toString();
           anno.pic_alt=annotation.getProperty("pic_alt").toString();
           anno.pic_path=annotation.getProperty("pic_path").toString();
           anno.poiname=annotation.getProperty("poiname").toString();
           anno.updatetime=annotation.getProperty("updatetime").toString();

           annos.add(anno);
         }
         
         }
         }else
         {
        	 annos=null;
        	 }
     } 
     catch (Exception e) 
     { 
      e.printStackTrace ();
      
      return null;
     }
	
return annos;

}
*/
public static List poiviaGeo(double lat,double lon,int distance,boolean filters,boolean mobile,boolean verkehr,boolean gesundheit,boolean essen_und_trinken,boolean bank_und_post,boolean bildung){
	
	final String METHOD_NAME = "getPOIInfoViaGPS"; 
	final String URL = "http://141.76.84.22/webservice/poi.asmx?wsdl";
	final String SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	List<poi> apoi=new ArrayList<poi>();
	String flat=Double.toString(lat);
	String flon=Double.toString(lon);
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	distance=500;
	request.addProperty("lat", flat);
	request.addProperty("lon",flon);
	request.addProperty("distance", distance);
	request.addProperty("filters", filters); 
	request.addProperty("mobile", mobile);
	request.addProperty("traffic", verkehr);
	request.addProperty("health", gesundheit);
	request.addProperty("food_and_drink", essen_und_trinken);
	request.addProperty("bank_and_post", bank_und_post);
	request.addProperty("edu", bildung);
	
	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
    

     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         SoapObject resultsRequestSOAP = (SoapObject)envelope.bodyIn;
         
         if(!resultsRequestSOAP.equals(null))
         { 
        	if(resultsRequestSOAP.getPropertyCount()>0){
         SoapObject result=(SoapObject)resultsRequestSOAP.getProperty(0);	
        		
         int num=result.getPropertyCount();
          
         for(int i=0;i<num;i++)
         { 
        	 poi pois=new poi();
           SoapObject poires=(SoapObject)result.getProperty(i);
      
           pois.osm_id=Integer.parseInt(poires.getProperty("osm_id").toString());

           pois.amenity=poires.getProperty("amenity").toString();

           pois.type=poires.getProperty("type").toString();

           pois.name=poires.getProperty("name").toString();

           
           apoi.add(pois);
         }
         
         }
         }else
         {
        	 apoi=null;
        	 }
     } 
     catch (Exception e) 
     { 
      e.printStackTrace ();
      
      return null;
     }
	
return apoi;

}
	
/*
public static List annotationviaKey(String key1,String value1,String key2, String value2,boolean fuzzysearch){
	final String METHOD_NAME = "getAnnoInfo"; 
	final String URL = "http://141.76.84.22/webservice/annotation.asmx?wsdl";
	final String SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	List annos=new ArrayList();
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	
	request.addProperty("attribute1",key1);
	request.addProperty("keyword1",value1);
	request.addProperty("attribute2",key2);
	request.addProperty("keyword2",value2);
	request.addProperty("fuzzysearch",fuzzysearch);
	
	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
    

     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         SoapObject resultsRequestSOAP = (SoapObject)envelope.bodyIn;
         
         if(!resultsRequestSOAP.equals(null))
         { 
        	if(resultsRequestSOAP.getPropertyCount()>0){
         SoapObject result=(SoapObject)resultsRequestSOAP.getProperty(0);	
        		
         int num=result.getPropertyCount();
          
         for(int i=0;i<num;i++)
         { 
        	 annotations anno=new annotations();
           SoapObject annotation=(SoapObject)result.getProperty(i);
           anno.userid=Integer.parseInt(annotation.getProperty("userid").toString());
           anno.osm_id=Integer.parseInt(annotation.getProperty("osm_id").toString());
           anno.poiid=Integer.parseInt(annotation.getProperty("poiid").toString());
           anno.version=Integer.parseInt(annotation.getProperty("version").toString());
           anno.anonymous=annotation.getProperty("anonymous").toString();
           anno.audio_alt=annotation.getProperty("audio_alt").toString();
           anno.audio_path=annotation.getProperty("audio_path").toString();
           anno.codx=annotation.getProperty("codx").toString();
           anno.cody=annotation.getProperty("cody").toString();
           anno.context=annotation.getProperty("context").toString();
           anno.creattime=annotation.getProperty("creattime").toString();
           anno.pic_alt=annotation.getProperty("pic_alt").toString();
           anno.pic_path=annotation.getProperty("pic_path").toString();
           anno.poiname=annotation.getProperty("poiname").toString();
           anno.updatetime=annotation.getProperty("updatetime").toString();

           annos.add(anno);
         }
         
         }
         }else
         {
        	 annos=null;
        	 }
     } 
     catch (Exception e) 
     { 
      e.printStackTrace ();
      
      return null;
     }
	
return annos;

}

*/

public static List poiviaKey(String key1,String value1,String key2, String value2,boolean fuzzysearch){
	final String METHOD_NAME = "getPOIInfo"; 
	final String URL = "http://141.76.84.22/webservice/poi.asmx?wsdl";
	final String SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	List lpois=new ArrayList();
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	
	request.addProperty("attribute1",key1);
	request.addProperty("keyword1",value1);
	request.addProperty("attribute2",key2);
	request.addProperty("keyword2",value2);
	request.addProperty("fuzzysearch",fuzzysearch);
	
	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
    

     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         SoapObject resultsRequestSOAP = (SoapObject)envelope.bodyIn;
         
         if(!resultsRequestSOAP.equals(null))
         { 
        	if(resultsRequestSOAP.getPropertyCount()>0){
         SoapObject result=(SoapObject)resultsRequestSOAP.getProperty(0);	
        		
         int num=result.getPropertyCount();
          
         for(int i=0;i<num;i++)
         { 
           poi pois=new poi();
           SoapObject poiso=(SoapObject)result.getProperty(i);
           
           pois.osm_id=Integer.parseInt(poiso.getProperty("osm_id").toString());
           pois.amenity=poiso.getProperty("amenity").toString();
           pois.name=poiso.getProperty("name").toString();
           if(poiso.getProperty("building").toString().equals("anyType{}") || poiso.getProperty("building").toString().equals("Null"))
           {
        	   pois.building="No";
        	   }
           else
           {
        	   pois.building=poiso.getProperty("building").toString();
        	   }

           lpois.add(pois);
         }
         
         }
         }else
         {
        	 lpois=null;
        	 }
     } 
     catch (Exception e) 
     { 
      e.printStackTrace ();
      
      return null;
     }
	
return lpois;

}

public static String creatanno(long osmid,long userid,String poiname,String content,String codx,String cody,String anonymous,boolean mobile){
	final String METHOD_NAME = "creatAnnotation"; 
	final String URL = "http://141.76.84.22/webservice/annotation.asmx?wsdl";
	final String SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	
	request.addProperty("osmid",osmid);
	request.addProperty("userid",userid);
	request.addProperty("poiname",poiname);
	request.addProperty("content",content);
	request.addProperty("pic_alt",null);
	request.addProperty("pic_path",null);
	request.addProperty("audio_alt",null);
	request.addProperty("audio_path",null);
	request.addProperty("codx",codx);
	request.addProperty("cody",cody);
	request.addProperty("anonymous",anonymous);
	request.addProperty("mobile",mobile);
	
	
	
	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
    

     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         SoapObject resultsRequestSOAP = (SoapObject)envelope.bodyIn;
         SoapObject results=(SoapObject)resultsRequestSOAP.getProperty(0);
         String result=results.getProperty("info").toString();
         return result;
        
     } 
     catch (Exception e) 
     { 
      e.printStackTrace ();
      return null;
     
     }
}

public static Long creatpoi(String access,String addr_flats,String addr_housenumber,String addr_interpolation,String admin_level,String aerialway,String aeroway, String amenity,String area,String barrier,String bicycle,String bridge,String boundary,String building, String capital,String construction,String cutting, String disused, String ele,String embankment,String foot, String highway,String historic,String horse,String junction,String landuse,String layer,String learning,String leisure,String lock1,String man_made,String military,String motorcar,String name,String oneway,String poi,String power,String power_source,String place,String railway,String ref1,String religion,String residence,String route,String service,String sport,String tourism,String tunnel,String waterway,String width,String wood,int z_order,String annotation,String question,String codx,String cody,Long uid,boolean mobile){
	
	final String METHOD_NAME = "creatPOI"; 
	final String URL = "http://141.76.84.22/webservice/poi.asmx?wsdl";
	final String SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	
	//String flat=Float.toString(codx);
	//String flon=Float.toString(cody);
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	

	
	request.addProperty("access","Null");
	request.addProperty("addr_flats","Null");
	request.addProperty("addr_housenumber","Null");
	request.addProperty("addr_interpolation","Null");
	request.addProperty("admin_level","Null");
	request.addProperty("aerialway","Null");
	request.addProperty("aeroway","Null");
	request.addProperty("amenity",amenity);
	request.addProperty("area","Null");
	request.addProperty("barrier","Null");
	request.addProperty("bicycle","Null");
	request.addProperty("bridge","Null");
	request.addProperty("boundary","Null");
	request.addProperty("building",building);
	request.addProperty("capital","Null");
	request.addProperty("construction","Null");
	request.addProperty("cutting","Null");
	request.addProperty("disused","Null");
	request.addProperty("ele","Null");
	request.addProperty("embankment","Null");
	request.addProperty("foot","Null");
	request.addProperty("highway","Null");
	request.addProperty("historic","Null");
	request.addProperty("horse","Null");
	request.addProperty("junction","Null");
	request.addProperty("landuse","Null");
	request.addProperty("layer","Null");
	request.addProperty("learning","Null");
	request.addProperty("leisure","Null");
	request.addProperty("lock1","Null");
	request.addProperty("man_made","Null");
	request.addProperty("military","Null");
	request.addProperty("motorcar","Null");
	request.addProperty("name",name);
	request.addProperty("oneway","Null");
	request.addProperty("poi","Null");
	request.addProperty("power","Null");
	request.addProperty("power_source","Null");
	request.addProperty("place","Null");
	request.addProperty("railway","Null");
	request.addProperty("ref1","Null");
	request.addProperty("religion","Null");
	request.addProperty("residence","Null");
	request.addProperty("route","Null");
	request.addProperty("service","Null");
	request.addProperty("sport","Null");
	request.addProperty("tourism","Null");
	request.addProperty("tunnel","Null");
	request.addProperty("waterway","Null");
	request.addProperty("width","Null");
	request.addProperty("wood","Null");
	request.addProperty("z_order",z_order);
	request.addProperty("annotation",annotation);
	request.addProperty("question",question);
	request.addProperty("codx",codx);
	request.addProperty("cody",cody);
	request.addProperty("mobile",mobile);
	request.addProperty("mobile",uid);
	
	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
    

     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         SoapObject resultsRequestSOAP = (SoapObject)envelope.bodyIn;
         SoapObject results=(SoapObject)resultsRequestSOAP.getProperty(0);
         Long result=Long.parseLong(results.getProperty("osm_id").toString());
         return result;
         
        
     } 
     catch (Exception e) 
     { 
      e.printStackTrace ();
      return (long) 0;
     
     }
}

public static poigeo geopoi(long osmid){

	final String METHOD_NAME = "POIGeoInfo"; 
	final String URL = "http://141.76.84.22/webservice/poi.asmx?wsdl";
	final String SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	poigeo geos=new poigeo();
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	
	request.addProperty("osm_id",osmid);
	
	
	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
    

     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         SoapObject resultsRequestSOAP = (SoapObject)envelope.bodyIn;
         if(!resultsRequestSOAP.equals(null))
         { 
        	if(resultsRequestSOAP.getPropertyCount()>0){
         SoapObject result=(SoapObject)resultsRequestSOAP.getProperty(0);	
           
           geos.osm_id=Integer.parseInt(result.getProperty("osm_id").toString());
           geos.lat=Double.parseDouble(result.getProperty("lat").toString());
           geos.lon=Double.parseDouble(result.getProperty("lon").toString());
			System.out.println(geos.lat+"/"+geos.lon);
         
         }
         }else
         {
        	return null;
        	 }
     } 
     catch (Exception e) 
     { 
      e.printStackTrace ();
      
      return null;
     }
	return geos;
	}

public static String createentranceAnno (long user_id, long osm_id,double lat,double lon, boolean main_entrance, boolean sliding, boolean automatic, boolean revolving, boolean steps, boolean accessibility){
	final String METHOD_NAME="createAnnoEntrance";
	final String URL="http://141.76.84.22/webservice/annotation.asmx?wsdl";
	final String 	SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	
	String flat=Double.toString(lat);
	String flon=Double.toString(lon);
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	System.out.println(user_id+"/"+osm_id+"/"+lat+"/"+lon+"/"+main_entrance+automatic+revolving+steps+accessibility+sliding);
	
	request.addProperty("userid",user_id);
	request.addProperty("osm_id",osm_id);
	request.addProperty("lat",flat);
	request.addProperty("lon",flon);
	request.addProperty("steps",steps);
	request.addProperty("accessibility",accessibility);
	request.addProperty("main_entrance",main_entrance);
	request.addProperty("sliding",sliding);
	request.addProperty("automatic",automatic);
	request.addProperty("revolving",revolving);
	
	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
    	 System.out.println("entranceAnno try");
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         System.out.println("call");
         SoapPrimitive resultsRequestSOAP = (SoapPrimitive)envelope.getResponse();
         String result=resultsRequestSOAP.toString();
         System.out.println(result+"web service return");
         return result;
     }
     catch (Exception e) {
    	 System.out.println("exception");
         e.printStackTrace ();
    	 return "failed";
     }
	
	}

@SuppressWarnings("null")

public static entrance getentranceAnno (long osm_id)
{
	final String METHOD_NAME="getAnnoEntrance";
	final String URL="http://141.76.84.22/webservice/annotation.asmx?wsdl";
	final String SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	request.addProperty("osm_ID",osm_id);
	SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request); 
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 
    try 
    { 
   	 System.out.println("try");
        androidHttpTransport.call(SOAP_ACTION, envelope); 
        SoapObject resultsRequestSOAP = (SoapObject)envelope.bodyIn;
        		SoapObject results =(SoapObject)resultsRequestSOAP.getProperty(0);	
        		System.out.println("call");
        		entrance ent=new entrance();
        		ent.osm_id=Integer.parseInt(results.getProperty("osm_id").toString());
        		ent.steps=Boolean.parseBoolean(results.getProperty("steps").toString());
        		ent.main_entrance=Boolean.parseBoolean( results.getProperty("main_entrance").toString());
        		ent.sliding=Boolean.parseBoolean(results.getProperty("sliding").toString());
        		ent.automatic=Boolean.parseBoolean( results.getProperty("automatic").toString());
        		ent.revolving=Boolean.parseBoolean( results.getProperty("revolving").toString());
        		ent.accessibility=Boolean.parseBoolean(results.getProperty("accessibility").toString());
        		ent.lat=Double.parseDouble(results.getProperty("lat").toString());
        		ent.lon=Double.parseDouble(results.getProperty("lon").toString());
        		System.out.println("webservice"+ent.lat+"/"+ent.lon);
        		return ent;
    }
    catch (Exception e) {
   	 System.out.println("exception");
        e.printStackTrace ();
   	 return null;
    }
}

public static String updateentranceAnno(long user_id, long osm_id,double lat,double lon, boolean main_entrance, boolean sliding, boolean automatic, boolean revolving, boolean steps, boolean accessibility){
	final String METHOD_NAME="updateAnnoEntrance";
	final String URL="http://141.76.84.22/webservice/annotation.asmx?wsdl";
	final String 	SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	
	String flat=Double.toString(lat);
	String flon=Double.toString(lon);
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	System.out.println(user_id+"/"+osm_id+"/"+lat+"/"+lon+"/"+main_entrance+automatic+revolving+steps+accessibility+sliding);
	
	request.addProperty("user_id",user_id);
	request.addProperty("osm_id",osm_id);
	request.addProperty("lat",flat);
	request.addProperty("lon",flon);
	request.addProperty("steps",steps);
	request.addProperty("accessibility",accessibility);
	request.addProperty("main_entrance",main_entrance);
	request.addProperty("sliding",sliding);
	request.addProperty("automatic",automatic);
	request.addProperty("revolving",revolving);
	
	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
    	 System.out.println("entranceAnno try");
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         System.out.println("call");
         SoapPrimitive resultsRequestSOAP = (SoapPrimitive)envelope.getResponse();
         String result=resultsRequestSOAP.toString();
         System.out.println(result+"web service return");
         return result;
     }
     catch (Exception e) {
    	 System.out.println("exception");
         e.printStackTrace ();
    	 return "failed";
     }
	
	}

public static String createNeighborpointAnno(long user_id, long osm_id,double lat, double lon, int distance, boolean level, boolean steps, boolean slope){
	
	final String METHOD_NAME="createNeighborpointAnno";
	final String URL="http://141.76.84.22/webservice/annotation.asmx?wsdl";
	final String 	SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	String flat=Double.toString(lat);
	String flon=Double.toString(lon);
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	
	request.addProperty("user_id",user_id);
	request.addProperty("osm_id",osm_id);
	request.addProperty("lat",flat);
	request.addProperty("lon",flon);
	request.addProperty("distance",distance);
	request.addProperty("level",level);
	request.addProperty("steps_way",steps);
	request.addProperty("slope",slope);

	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
    	 System.out.println("entranceAnno try");
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         System.out.println("call");
         SoapPrimitive resultsRequestSOAP = (SoapPrimitive)envelope.getResponse();
         String result=resultsRequestSOAP.toString();
         System.out.println(result+"web service return");
         return result;
     }
     catch (Exception e) {
    	 System.out.println("exception");
         e.printStackTrace ();
    	 return "failed";
     }
	
}

public static nbpoint getNeiborpointAnno(long osm_id){
	
	final String METHOD_NAME="getNeiborpointAnno";
	final String URL="http://141.76.84.22/webservice/annotation.asmx?wsdl";
	final String SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	request.addProperty("osm_id",osm_id);
	SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request); 
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 
    try 
    { 
   	 System.out.println("try");
        androidHttpTransport.call(SOAP_ACTION, envelope); 
        SoapObject resultsRequestSOAP = (SoapObject)envelope.bodyIn;
        		SoapObject results =(SoapObject)resultsRequestSOAP.getProperty(0);	
        		System.out.println("call");
        		nbpoint nb=new nbpoint();
        		nb.osm_id=Integer.parseInt(results.getProperty("osm_id").toString());
        		System.out.println(nb.osm_id);
        		nb.lat=Double.parseDouble(results.getProperty("lat").toString());
        		nb.lon=Double.parseDouble(results.getProperty("lon").toString());
        		nb.lat_entrance=Double.parseDouble(results.getProperty("lat_entrance").toString());
        		nb.lon_entrance=Double.parseDouble(results.getProperty("lon_entrance").toString());
        		nb.distance =Integer.parseInt(results.getProperty("distance").toString());
        		nb.level=Boolean.parseBoolean( results.getProperty("level").toString());
        		nb.steps_way=Boolean.parseBoolean( results.getProperty("steps_way").toString());
        		nb.slope=Boolean.parseBoolean(results.getProperty("slope").toString());
        		
        		return nb;
    }
    catch (Exception e) {
   	 System.out.println("exception");
        e.printStackTrace ();
   	 return null;
    }
}

public static String updateNeiborpointAnno(long osm_id,int distance, boolean level, boolean steps, boolean slope){
	final String METHOD_NAME="updateNeiborpointAnno";
	final String URL="http://141.76.84.22/webservice/annotation.asmx?wsdl";
	final String 	SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	request.addProperty("osm_id",osm_id);
	request.addProperty("distance", distance);
	request.addProperty("level",level);
	request.addProperty("steps_way",steps);
	request.addProperty("slope",slope);

	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
    	 System.out.println("entranceAnno try");
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         System.out.println("call");
         SoapPrimitive resultsRequestSOAP = (SoapPrimitive)envelope.getResponse();
         String result=resultsRequestSOAP.toString();
         System.out.println(result+"web service return");
         return result;
     }
     catch (Exception e) {
    	 System.out.println("exception");
         e.printStackTrace ();
    	 return "failed";
     }
}

public static List getCommentList(long user_id, long osm_id){
	final String METHOD_NAME = "getCommentList"; 
	final String URL = "http://141.76.84.22/webservice/comment.asmx?wsdl";
	final String SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	List<comment> comments=new ArrayList<comment>();;
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	request.addProperty("user_id",user_id);
	request.addProperty("osm_id", osm_id);

	
	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
    

     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         SoapObject resultsRequestSOAP = (SoapObject)envelope.bodyIn;
         
         if(!resultsRequestSOAP.equals(null))
         { 
        	if(resultsRequestSOAP.getPropertyCount()>0){
         SoapObject result=(SoapObject)resultsRequestSOAP.getProperty(0);	
        		
         int num=result.getPropertyCount();
          
         for(int i=0;i<num;i++)
         { 
        	 comment comment=new comment();
           SoapObject comres=(SoapObject)result.getProperty(i);

           comment.comment_id=Integer.parseInt(comres.getProperty("annotation_id").toString());
           System.out.println(comment.comment_id);
           comment.author=comres.getProperty("author").toString();

           comment.type=comres.getProperty("type").toString();
           
           comment.date=comres.getProperty("date").toString();
           System.out.println(comment.date);
           comments.add(comment);
         }
         
         }
         }else
         {
        	 comments=null;
        	 }
     } 
     catch (Exception e) 
     { 
      e.printStackTrace ();
      
      return null;
     }
	
return comments;
	
}

public static String getCommentText(long comment_id){
	
	final String METHOD_NAME="getCommentText";
	final String URL="http://141.76.84.22/webservice/comment.asmx?wsdl";
	final String SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	request.addProperty("annotation_id",comment_id);
	SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request); 
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 
    try 
    { 
    	System.out.println("entranceAnno try");
        androidHttpTransport.call(SOAP_ACTION, envelope); 
        System.out.println("call");
        SoapPrimitive resultsRequestSOAP = (SoapPrimitive)envelope.getResponse();
        String result=resultsRequestSOAP.toString();
        System.out.println(result+"web service return");
        return result;
    }
    catch (Exception e) {
   	 System.out.println("exception");
        e.printStackTrace ();
   	 return "failed";
    }
	
}

public static String getCommentAudio(long comment_id){
	
	final String METHOD_NAME="getCommentAudio";
	final String URL="http://141.76.84.22/webservice/comment.asmx?wsdl";
	final String SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	request.addProperty("annotation_id",comment_id);
	SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request); 
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 
    try 
    { 
    	System.out.println("entranceAnno try");
        androidHttpTransport.call(SOAP_ACTION, envelope); 
        System.out.println("call");
        SoapPrimitive resultsRequestSOAP = (SoapPrimitive)envelope.getResponse();
        String result=resultsRequestSOAP.toString();
        System.out.println(result+"web service return");
        return result;
    }
    catch (Exception e) {
   	 System.out.println("exception");
        e.printStackTrace ();
   	 return "failed";
    }
	
}

public static String createComment(long user_id, long osm_id, String text,boolean anonym,boolean self){
	
	final String METHOD_NAME="createCommentText";
	final String URL="http://141.76.84.22/webservice/comment.asmx?wsdl";
	final String 	SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	
	request.addProperty("user_id",user_id);
	request.addProperty("osm_id",osm_id);
	request.addProperty("text",text);
	request.addProperty("anonym",anonym);
	request.addProperty("self",self);
	System.out.println(user_id);
	System.out.println(osm_id);
	System.out.println(text);
	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
    	 System.out.println("createComment try");
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         System.out.println("call");
         SoapPrimitive resultsRequestSOAP = (SoapPrimitive)envelope.getResponse();
         String result=resultsRequestSOAP.toString();
         System.out.println(result+"web service return");
         return result;
     }
     catch (Exception e) {
    	 System.out.println("exception");
         e.printStackTrace ();
    	 return "failed";
     }
	
}

public static String createCommentAudio(long osm_id, long user_id, String audio,boolean anonym,boolean self){
	final String METHOD_NAME="createCommentAudio";
	final String URL="http://141.76.84.22/webservice/comment.asmx?wsdl";
	final String 	SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	
	request.addProperty("user_id",user_id);
	request.addProperty("osm_id",osm_id);
	request.addProperty("audio",audio);
	request.addProperty("anonym",anonym);
	request.addProperty("self",self);
	System.out.println(user_id);
	System.out.println(osm_id);
	System.out.println();
	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
    	 System.out.println("createComment try");
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         System.out.println("call");
         SoapPrimitive resultsRequestSOAP = (SoapPrimitive)envelope.getResponse();
         String result=resultsRequestSOAP.toString();
         System.out.println(result+"web service return");
         return result;
     }
     catch (Exception e) {
    	 System.out.println("exception");
         e.printStackTrace ();
    	 return "failed";
     }
	
}

public static assessment getAssessment(long osm_id){
	
	final String METHOD_NAME="getAssessment";
	final String URL="http://141.76.84.22/webservice/assessment.asmx?wsdl";
	final String SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	request.addProperty("osm_id",osm_id);
	SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request); 
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 
    try 
    { 

    	  androidHttpTransport.call(SOAP_ACTION, envelope); 
          SoapObject resultsRequestSOAP = (SoapObject)envelope.bodyIn;
          		SoapObject results =(SoapObject)resultsRequestSOAP.getProperty(0);	
        assessment ass= new assessment();
        ass.osm_id=Integer.parseInt(results.getProperty("osm_id").toString());
        ass.safety=Double.parseDouble(results.getProperty("safety").toString());
        System.out.println(ass.safety);
        ass.accessibility=Double.parseDouble(results.getProperty("accessibility").toString());
        System.out.println(ass.accessibility);
        ass.orientation=Double.parseDouble(results.getProperty("orientation").toString());
        System.out.println(ass.orientation);
        

        return ass;
    }
    catch (Exception e) {
   	 System.out.println("exception");
        e.printStackTrace ();
   	 return null;
    }
}

public static String createAssessment(long user_id, long osm_id, int safety,int accessibility, int orientation){
	final String METHOD_NAME="createAssessment";
	final String URL="http://141.76.84.22/webservice/assessment.asmx?wsdl";
	final String 	SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	
	request.addProperty("user_id",user_id);
	request.addProperty("osm_id",osm_id);
	request.addProperty("safety",safety);
	request.addProperty("accessibility",accessibility);
	request.addProperty("orientation",orientation);
	
	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
    	 System.out.println("createComment try");
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         System.out.println("call");
         SoapPrimitive resultsRequestSOAP = (SoapPrimitive)envelope.getResponse();
         String result=resultsRequestSOAP.toString();
         System.out.println(result+"web service return");
         return result;
     }
     catch (Exception e) {
    	 System.out.println("exception");
         e.printStackTrace ();
    	 return "failed";
     }
	
}

public static String createCrossingAnno(long user_id, long osm_id, double lat, double lon, String name, boolean insideisland, boolean trafficlights, boolean roundabout, String type){

	final String METHOD_NAME="createCrossingAnno";
	final String URL="http://141.76.84.22/webservice/annotation.asmx?wsdl";
	final String 	SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	String flat=Double.toString(lat);
	String flon=Double.toString(lon);
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	
	request.addProperty("user_id",user_id);
	System.out.println("crossing:"+user_id);
	request.addProperty("osm_id",osm_id);
	System.out.println("crossing:"+osm_id);
	request.addProperty("lat",flat);
	request.addProperty("lon", flon);
	request.addProperty("name",name);
	request.addProperty("insideisland",insideisland);
	request.addProperty("trafficlights",trafficlights);
	request.addProperty("roundabout",roundabout);
	request.addProperty("type",type);
	System.out.println("crossing:"+type);
/*	request.addProperty("trafficlights_audio",trafficlights_audio);
	request.addProperty("trafficlights_insideisland",trafficlights_insideisland);
	request.addProperty("trafficlights_directionsymbol",trafficlights_directionsymbol);
	request.addProperty("trafficlights_vibration",trafficlights_vibration);*/

	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
    	 System.out.println("entranceAnno try");
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         System.out.println("call");
         SoapPrimitive resultsRequestSOAP = (SoapPrimitive)envelope.getResponse();
         String result=resultsRequestSOAP.toString();
         System.out.println(result+"web service return");
         return result;
     }
     catch (Exception e) {
    	 System.out.println("exception");
         e.printStackTrace ();
    	 return "failed";
     }
}
	
public static crossingannotation getCrossingAnno(long osm_id){

	final String METHOD_NAME="getCrossingAnno";
	final String URL="http://141.76.84.22/webservice/annotation.asmx?wsdl";
	final String SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	request.addProperty("osm_id",osm_id);
	SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request); 
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 
    try 
    { 
   	 System.out.println("try");
        androidHttpTransport.call(SOAP_ACTION, envelope); 
        SoapObject resultsRequestSOAP = (SoapObject)envelope.bodyIn;
        		SoapObject results =(SoapObject)resultsRequestSOAP.getProperty(0);	
        		System.out.println("call");
        		crossingannotation ca=new crossingannotation();
        		ca.osm_id=Integer.parseInt(results.getProperty("osm_id").toString());
        		ca.lat=Double.parseDouble(results.getProperty("lat").toString());
        		ca.lon=Double.parseDouble(results.getProperty("lon").toString());
        		ca.streetname=results.getPropertyAsString("streetname").toString();      		
        		ca.insideisland=Boolean.parseBoolean( results.getProperty("insideisland").toString());
        		ca.trafficlight=Boolean.parseBoolean( results.getProperty("trafficlight").toString());
        		ca.roundabout=Boolean.parseBoolean(results.getProperty("roundabout").toString());
        		ca.type = results.getPropertyAsString("type").toString();   
/*        		ca.trafficlights_audio=Boolean.parseBoolean( results.getProperty("trafficlights_audio").toString());
        		ca.trafficlights_insideisland=Boolean.parseBoolean( results.getProperty("trafficlights_insideisland").toString());
        		ca.trafficlights_directionsymbol=Boolean.parseBoolean( results.getProperty("trafficlights_directionsymbol").toString());
        		ca.trafficlights_vibration=Boolean.parseBoolean( results.getProperty("trafficlights_vibration").toString());*/
        		
        		return ca;
    }
    catch (Exception e) {
   	 System.out.println("exception");
        e.printStackTrace ();
   	 return null;
    }
}

public static String updateCrossingAnno(long user_id, long osm_id, double lat, double lon, String name, boolean insideisland, boolean trafficlights, boolean roundabout, String type){

	final String METHOD_NAME="updateCrossingAnno";
	final String URL="http://141.76.84.22/webservice/annotation.asmx?wsdl";
	final String 	SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	String flat=Double.toString(lat);
	String flon=Double.toString(lon);
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	
	request.addProperty("user_id",user_id);
	request.addProperty("osm_id",osm_id);
	request.addProperty("lat",flat);
	request.addProperty("lon", flon);
	request.addProperty("name",name);
	request.addProperty("insideisland",insideisland);
	request.addProperty("trafficlights",trafficlights);
	request.addProperty("roundabout",roundabout);
	request.addProperty("type",type);
/*	request.addProperty("trafficlights_audio",trafficlights_audio);
	request.addProperty("trafficlights_insideisland",trafficlights_insideisland);
	request.addProperty("trafficlights_directionsymbol",trafficlights_directionsymbol);
	request.addProperty("trafficlights_vibration",trafficlights_vibration);*/

	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
    	 System.out.println("updateCrossingAnno try");
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         System.out.println("call");
         SoapPrimitive resultsRequestSOAP = (SoapPrimitive)envelope.getResponse();
         String result=resultsRequestSOAP.toString();
         System.out.println(result+"web service return");
         return result;
     }
     catch (Exception e) {
    	 System.out.println("exception");
         e.printStackTrace ();
    	 return "failed";
     }
}

public static String createStationAnno(long user_id, long osm_id, double lat, double lon, String line, boolean bus, boolean str, boolean dopple, boolean shed){

	final String METHOD_NAME="createStationAnno";
	final String URL="http://141.76.84.22/webservice/annotation.asmx?wsdl";
	final String 	SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	String flat=Double.toString(lat);
	String flon=Double.toString(lon);
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	
	request.addProperty("user_id",user_id);
	request.addProperty("osm_id",osm_id);
	request.addProperty("lat",flat);
	request.addProperty("lon", flon);
	request.addProperty("line",line);
	request.addProperty("bus",bus);
	request.addProperty("str",str);
	request.addProperty("dopple",dopple);
	request.addProperty("shed",shed);
	
	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
    	 System.out.println("createStationAnno try");
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         System.out.println("call");
         SoapPrimitive resultsRequestSOAP = (SoapPrimitive)envelope.getResponse();
         String result=resultsRequestSOAP.toString();
         System.out.println(result+"web service return");
         return result;
     }
     catch (Exception e) {
    	 System.out.println("exception");
         e.printStackTrace ();
    	 return "failed";
     }
}

public static stationannotation getStationAnno(long osm_id){

	final String METHOD_NAME="getStationAnno";
	final String URL="http://141.76.84.22/webservice/annotation.asmx?wsdl";
	final String SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	request.addProperty("osm_id",osm_id);
	SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request); 
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 
    try 
    { 
   	 System.out.println("try");
        androidHttpTransport.call(SOAP_ACTION, envelope); 
        SoapObject resultsRequestSOAP = (SoapObject)envelope.bodyIn;
        		SoapObject results =(SoapObject)resultsRequestSOAP.getProperty(0);	
        		System.out.println("call");
        		stationannotation sa=new stationannotation();
        		sa.osm_id=Integer.parseInt(results.getProperty("osm_id").toString());
        		System.out.println(results.getProperty("osm_id").toString());
        		sa.lat=Double.parseDouble(results.getProperty("lat").toString());
        		sa.lon=Double.parseDouble(results.getProperty("lon").toString()); 
        		sa.line=results.getProperty("line").toString();
        		sa.bus=Boolean.parseBoolean( results.getProperty("bus").toString());
        		sa.str=Boolean.parseBoolean( results.getProperty("str").toString());
        		sa.doppel=Boolean.parseBoolean( results.getProperty("doppel").toString());
        		sa.shed=Boolean.parseBoolean( results.getProperty("shed").toString());
        		return sa;
    }
    catch (Exception e) {
   	 System.out.println("exception");
        e.printStackTrace ();
   	 return null;
    }
	
}

public static String updateStationAnno(long osm_id, long user_id, double lat, double lon, String line, boolean bus, boolean str, boolean dopple, boolean shed){

	final String METHOD_NAME="updateStationAnno";
	final String URL="http://141.76.84.22/webservice/annotation.asmx?wsdl";
	final String 	SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	
	String flat=Double.toString(lat);
	String flon=Double.toString(lon);
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	
	request.addProperty("userid",user_id);
	request.addProperty("osm_id",osm_id);
	request.addProperty("lat",flat);
	request.addProperty("lon", flon);
	request.addProperty("line",line);
	request.addProperty("bus",bus);
	request.addProperty("str",str);
	request.addProperty("dopple",dopple);
	request.addProperty("shed",shed);
	
	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
    	 System.out.println("updateStationAnno try");
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         System.out.println("call");
         SoapPrimitive resultsRequestSOAP = (SoapPrimitive)envelope.getResponse();
         String result=resultsRequestSOAP.toString();
         System.out.println(result+"web service return");
         return result;
     }
     catch (Exception e) {
    	 System.out.println("exception");
         e.printStackTrace ();
    	 return "failed";
     }
}


public static String updateAmpelAnno(long user_id, long osm_id, boolean trafficlights_audio, boolean trafficlights_insideisland, boolean trafficlights_directionsymbol,
		boolean trafficlights_vibration) {
	// TODO Auto-generated method stub
	final String METHOD_NAME="updateAmpelAnno";
	final String URL="http://141.76.84.22/webservice/annotation.asmx?wsdl";
	final String 	SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	
/*	String flat=Double.toString(lat);
	String flon=Double.toString(lon);*/
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	
	request.addProperty("userid",user_id);
	request.addProperty("osm_id",osm_id);
/*	request.addProperty("lat",flat);
	request.addProperty("lon", flon);*/
	request.addProperty("trafficlights_audio",trafficlights_audio);
	request.addProperty("trafficlights_insideisland",trafficlights_insideisland);
	request.addProperty("trafficlights_directionsymbol",trafficlights_directionsymbol);
	request.addProperty("trafficlights_vibration",trafficlights_vibration);
	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
    	 System.out.println("updateAmpelAnno try");
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         System.out.println("call");
         SoapPrimitive resultsRequestSOAP = (SoapPrimitive)envelope.getResponse();
         String result=resultsRequestSOAP.toString();
         System.out.println(result+"web service return");
         return result;
     }
     catch (Exception e) {
    	 System.out.println("exception");
         e.printStackTrace ();
    	 return "failed";
     }
}
public static String createAmpelAnno(long user_id, long osm_id, boolean trafficlights_audio, boolean trafficlights_insideisland, boolean trafficlights_directionsymbol,
		boolean trafficlights_vibration) {
	// TODO Auto-generated method stub
	final String METHOD_NAME="createAmpelAnno";
	final String URL="http://141.76.84.22/webservice/annotation.asmx?wsdl";
	final String 	SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	
/*	String flat=Double.toString(lat);
	String flon=Double.toString(lon);*/
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	
	request.addProperty("user_id",user_id);
	request.addProperty("osm_id",osm_id);
/*	request.addProperty("lat",flat);
	request.addProperty("lon", flon);*/
	request.addProperty("trafficlights_audio",trafficlights_audio);
	request.addProperty("trafficlights_insideisland",trafficlights_insideisland);
	request.addProperty("trafficlights_directionsymbol",trafficlights_directionsymbol);
	request.addProperty("trafficlights_vibration",trafficlights_vibration);
	 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     envelope.dotNet = true;
     envelope.setOutputSoapObject(request); 
     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

     try 
     { 
    	 System.out.println("createAmpelAnno try");
         androidHttpTransport.call(SOAP_ACTION, envelope); 
         System.out.println("call");
         SoapPrimitive resultsRequestSOAP = (SoapPrimitive)envelope.getResponse();
         String result=resultsRequestSOAP.toString();
         System.out.println(result+"web service return");
         return result;
     }
     catch (Exception e) {
    	 System.out.println("exception");
         e.printStackTrace ();
    	 return "failed";
     }
}
public static ampelanno getAmpelAnno(long osm_id) {
	// TODO Auto-generated method stub
	final String METHOD_NAME="getAmpelAnno";
	final String URL="http://141.76.84.22/webservice/annotation.asmx?wsdl";
	final String SOAP_ACTION=NAMESPACE+"/"+METHOD_NAME;
	final String info;
	
	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
	request.addProperty("osm_id",osm_id);
	SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request); 
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 
    try 
    { 
   	 System.out.println("try");
        androidHttpTransport.call(SOAP_ACTION, envelope); 
        SoapObject resultsRequestSOAP = (SoapObject)envelope.bodyIn;
        		SoapObject results =(SoapObject)resultsRequestSOAP.getProperty(0);	
        		System.out.println("call");
        		ampelanno aa=new ampelanno();
        		aa.osm_id=Integer.parseInt(results.getProperty("osm_id").toString());
        		aa.trafficlights_audio=Boolean.parseBoolean( results.getProperty("trafficlights_audio").toString());
        		aa.trafficlights_insideisland=Boolean.parseBoolean( results.getProperty("trafficlights_insideisland").toString());
        		aa.trafficlights_directionsymbol=Boolean.parseBoolean( results.getProperty("trafficlights_directionsymbol").toString());
        		aa.trafficlights_vibration=Boolean.parseBoolean( results.getProperty("trafficlights_vibration").toString());
        		System.out.println(aa.trafficlights_audio+"/"+aa.trafficlights_insideisland+"/"+aa.trafficlights_directionsymbol+"/"+aa.trafficlights_vibration);
        		return aa;
    }
    catch (Exception e) {
   	 System.out.println("exception");
        e.printStackTrace ();
   	 return null;
    }
}
}
